﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for CustomerBus
/// </summary>
public class CustomerBus
{
    CustomerDAL customerDal = new CustomerDAL();
	public CustomerBus()
	{
		
	}
    //add customer(register)
    public string addCustomer(Customer customer)
    {
        if (customerDal.insertCustomer(customer) == 0)
        {
            return "Register Fail !";
        }
        else
        {
            return "Register new customer successull !";
        }
    }
    //check login
    public bool IsValidLogin(string _username, string _password)
    {
        DataTable dt = new DataTable();

        dt = customerDal.getCustomerByUsername(_username, _password);

        if (dt.Rows.Count > 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
  

}